
<div id="showcate">
	
		
			
		<div id="cate_left">
			<?php
			$var = array('Category name', 'Edit', 'Delete');
			$this->table->set_heading($var);
			foreach ($categories as $cat) {
				$this->table->add_row(array($cat['category_name'], 
					'<a href="'.$backend.'func_edit_category/'.$cat['category_id'].'"><img src="'.$backendimg.'edit4.png" widht="23" height="23" ></a>', 
					'<a href="'.$backend.'func_delete_category/'.$cat['category_id'].'"><img src="'.$backendimg.'delete.png" widht="23" height="23" ></a>' ));
			}
			echo $this->table->generate(); 
			?>
		</div>	
	<div id="cate_right">
		<div id="message_cate">
		<?php  
		if(isset($message))
		{						
			echo $message.'<br>';
		}
		?>	
	</div>	
		<?php
		$count = count($categories);
		if($count<20){ ?>
		<div id="addcate">
			<h5>Add a category</h5>
			<form action="<?php echo $backend; ?>func_add_a_category" method="post" >
				<p>Category Name</p>
				<input type="text" name="category_name" size="30" ><br><br>
				<input type="submit" name="submit" value="Add" >

			</form>
		</div>

		<?php 
		} ?>
	        <?php
			//create a conditional to edit a single category
		if(isset($category)){ ?>
		<div id="editcate">
		<h5>Edit Category</h5>
		 <form action="<?php echo base_url();?>index.php/admin/manager/func_save_edited_cat" method="POST" >
		 	<p>Change Category name<p>
		 	<input type="text" name="category_name" value="<?php echo $category['category_name'];?>" size="30"><br><br>
		 	<input type="hidden" name="category_id" value="<?php echo $category['category_id'];?> " >
		 	<input type="submit" name="submit" value="Save">
		 </form>
		</div>

	   <?php 
		}

		?>
	</div>	
</div>
